/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;

/**
 *
 * @author THANHDAT
 */
public class DAO_Account {
        
    public DAO_Account() {
    }
    
    public void addAccount(String user, String pass, String full, String phone, String address, String email, String role)
    {        
        String query = "{call sp_Register(?,?,?,?,?,?,?)}";                       
        
        try {
            Connection conn = DAO_Connect.getConnection();
            CallableStatement cstm = conn.prepareCall(query);
            cstm.setString(1, user);
            cstm.setString(2, pass);
            cstm.setString(3, full);
            cstm.setString(4, phone);
            cstm.setString(5, address);
            cstm.setString(6, email);
            cstm.setString(7, role);
            cstm.executeUpdate();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }       
    }
}
